<?php
declare (strict_types = 1);

namespace app\admin\model;

use app\lib\FileDB;

/**
 * @mixin \think\Model
 */
class Records extends FileDB
{
    //
    //删除
    public static function del($id){
        return self::table('records')->delete($id);
    }
    //编辑
    public static function edit($data){
        if(!empty($data['supply_name'])){
            unset($data['supply_name']);
        }
        if(!empty($data['receive_name'])){
            unset($data['receive_name']);
        }
        if(!empty($data['user_name'])){
            unset($data['user_name']);
        }
        if(!empty($data['product_name'])){
            unset($data['product_name']);
        }
        $result = self::table('records')->update($data);
        return $result;
    }
}
